package com.wclass.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 课程基本信息
 * </p>
 *
 * @author 张浩高
 * @since 2018-12-21
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("course_info")
@SuppressWarnings("serial")
public class CourseInfo extends SuperEntity<CourseInfo> {


    /**
     * 是否删除 0：有效，1：删除
     */
    @JSONField(serialize = false)
    @TableLogic
    private Integer state = 0;
    /**
     * 课程名称
     */
    @ApiModelProperty("课程名称")
    private String name;
    /**
     * 上课老师id
     */
    @ApiModelProperty("上课老师id")
    @TableField("user_id")
    private Long userId;

    /**
     * 课程类型（json格式存储）
     */
    @ApiModelProperty("课程类型id")
    @TableField("course_type_id")
    private Long courseTypeId;
    /**
     * 课程开始时间
     */
    @ApiModelProperty("课程开始时间")
    @TableField("start_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;
    /**
     * 课程结束时间
     */
    @ApiModelProperty("课程结束时间")
    @TableField("end_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;
    /**
     * 价钱（精确到分）
     */
    @ApiModelProperty("价钱（单位：分）")
    private Long amount;
    /**
     * 课程简介
     */
    @ApiModelProperty("课程简介")
    private String about;
    /**
     * 课程详情(json存储)
     */
    @ApiModelProperty("课程详情(json存储)")
    private String details;


    @ApiModelProperty("封面图片地址")
    @TableField("cover_img_url")
    private String coverImgUrl;

    @ApiModelProperty("是否ios发行（0：不发行，1：发行）")
    @TableField("ios_release")
    private Integer iosRelease;

    @ApiModelProperty("审核状态（0：未审核，1：审核成功，2：审核失败，3：保存未发布）")
    @TableField("audit_state")
    private Integer auditState;

    @ApiModelProperty("审核意见")
    @TableField("audit_opinion")
    private String auditOpinion;

    @ApiModelProperty("审核时间")
    @TableField("audit_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date auditTime;

    @ApiModelProperty("等级 1 零基础 2 进阶")
    @TableField("level")
    private Integer level;
    /**
     * 创建人id
     */
    @ApiModelProperty("创建人id")
    @TableField("crt_user_id")
    private Long crtUserId;

    @ApiModelProperty("类型名称")
    @TableField("course_type_name")
    private String courseTypeName;

    @ApiModelProperty("课程类型（0：直播，1：点播）")
    @TableField("live_type")
    private Integer liveType;

    @ApiModelProperty("退款类型（0：课前退，1：7天退款）")
    @TableField("refund_type")
    private Integer refundType;

    @ApiModelProperty("助教json")
    @TableField("assistant")
    private String assistant;

    @ApiModelProperty("销售json")
    @TableField("sales")
    private String sales;
    /**
     * 评价标签（json存储）
     */
    @ApiModelProperty("评价标签（json存储）")
    @TableField("evaluate_label")
    private String evaluateLabel;

    @ApiModelProperty("成交数")
    @TableField("fixture_num")
    private Integer fixtureNum;

    @ApiModelProperty("评价数")
    @TableField("evaluate_num")
    private Integer evaluateNum;

    @ApiModelProperty("好评率")
    @TableField("feedback_rate")
    private Integer feedbackRate;

    @ApiModelProperty("评分")
    @TableField("star")
    private Double star;

    @ApiModelProperty("课程已录时长")
    @TableField("valid_duration")
    private Integer validDuration;

    @ApiModelProperty("上课老师昵称")
    @TableField(value = "nick_name", exist = false)
    private String nickName;

//    @ApiModelProperty("上课老师姓名")
//    @TableField(value = "user_name", exist = false)
//    private String userName;

    @ApiModelProperty("上课老师头像")
    @TableField(value = "picture_address", exist = false)
    private String pictureAddress;
    /**
     * 评级（1:A,2:B,3:C,4:D,5:E）
     */
    @ApiModelProperty("上课老师评级（1:A,2:B,3:C,4:D,5:E）")
    @TableField(value = "user_level", exist = false)
    private Integer userLevel;

    @ApiModelProperty("上课老师职位")
    @TableField(value = "postname", exist = false)
    private String postname;

    @ApiModelProperty("课程数量")
    @TableField(value = "course_num", exist = false)
    private Integer courseNum;

    @ApiModelProperty("学生数量")
    @TableField(value = "student_num", exist = false)
    private Integer studentNum;

    /**
     * 个人介绍
     */
    @ApiModelProperty("上课老师个人介绍")
    @TableField(value = "personal_intro", exist = false)
    private String personalIntro;


    @ApiModelProperty("章节")
    @TableField(exist = false)
    private List<CourseChapter> courseChapterList;


    @ApiModelProperty("作业数量")
    @TableField(exist = false)
    private Integer taskNum;

    @ApiModelProperty("是否购买（0：未购买，1：已购买）")
    @TableField(exist = false)
    private Integer isBuy;

    @ApiModelProperty("是否关注课程（0：未关注，1：已关注）")
    @TableField(exist = false)
    private Integer focusCourse;


    @ApiModelProperty("是否关注老师（0：未关注，1：已关注）")
    @TableField(exist = false)
    private Integer focusUser;

    @ApiModelProperty("直播状态（0：直播未开始，1：直播中，2：直播结束，3：点播）")
    @TableField(exist = false)
    private Integer liveState;

    @ApiModelProperty("课程所属机构信息")
    @TableField(exist = false)
    private BaseOrgan organInfo;

    @ApiModelProperty("课程课件列表")
    @TableField(exist = false)
    private List<CourseWare> courseWareList;
    /**
     * 评价状态，0：未评价，1：已评价
     */
    @ApiModelProperty("评价状态，0：未评价，1：已评价")
    @TableField(value = "evaluate_state", exist = false)
    private Integer evaluateState;
    /**
     * 课程最近学习时间
     */
    @ApiModelProperty("课程最近学习时间")
    @TableField(value = "latest_study_time", exist = false)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date latestStudyTime;

    @ApiModelProperty("班级群名称")
    @TableField("class_name")
    private String className;

    @ApiModelProperty("群聊的最新时间")
    @TableField(value = "up_time")
    private Date upTime;

    @ApiModelProperty("群聊介绍")
    private String introduce;

    @ApiModelProperty("群状态，0：正常，1：已解散")
    @TableField(value = "group_state")
    private Integer groupState;

    @ApiModelProperty("群禁言状态，0：正常，1：已禁言")
    @TableField(value = "ban_state")
    private Integer banState;

}
